<template>
  <el-tree
    :data="data"
    :props="defaultProps"
    @node-click="handleNodeClick"
  ></el-tree>
</template>

<script>
export default {
  data () {
    return {
      data: [
        {
          label: '项目经理-张大大',
          children: [
            {
              label: '产品leader-张臻',
              children: [
                {
                  label: '产品-小丽'
                },
                {
                  label: '产品-大光'
                }
              ]
            },
            {
              label: 'UIloader-余豚',
              children: [
                {
                  label: 'ui-小亮'
                }
              ]
            },
            {
              label: '技术loader-老马',
              children: [
                {
                  label: '前端-小刘'
                },
                {
                  label: '后端-小华'
                },
                {
                  label: '后端-小李'
                }
              ]
            },
            {
              label: '测试loader-吴凯翔',
              children: [
                {
                  label: '测试-小赵'
                },
                {
                  label: '测试-小强'
                }
              ]
            },
            {
              label: '运维loader-赖晗',
              children: [
                {
                  label: '运维-小涛'
                }
              ]
            }
          ]
        }
      ],
      defaultProps: {
        children: 'children',
        label: 'label'
      }
    }
  },
  methods: {
    handleNodeClick (data) {
      console.log(data)
    }
  }
}
</script>
